package com.pt.site.label;

import com.atled.validation.ParameterChecker;

public class StandardLabel implements ILabel {

	private final String key;
	private final String value;
	
	public StandardLabel(String key, String value) {
		ParameterChecker.notNull("key", key);
		this.key = key;
		this.value = value;
	}
	
	@Override
	public String getKey() {
		return key;
	}

	@Override
	public String getValue() {
		return value;
	}

	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append("<").append(key).append(":").append(value).append(">");
		return sb.toString();
	}
	
	@Override
	public int hashCode() {
		return key.hashCode();
	}
}
